<!DOCTYPE html>
<html style="height: 100%">
<head>
    <meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
$(function () {
    

    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    var option;
    var arraymonth = []
    var arraywendu = []
    $.get("/findAll", function (result) {
        // arrymonth = new Array(result.length);
        // arrywendu = new Array(result.length);
        for (let i = 0; i < result.length; i++) {
            arraymonth.push(result[i].month)
            arraywendu.push(result[i].wendu)
            option = {
                xAxis: {
                    type: 'category',
                    data: arraymonth,
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    data: arraywendu,
                    type: 'line'
                }]
            };
            if (option && typeof option === 'object') {
                myChart.setOption(option);

            }
        }
    })

})
</script>
</body>
</html>
